/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.gatech.gellinservlet.model;

import java.util.ArrayList;
import java.io.Serializable;

/**
 *
 * @author Tyler Powell
 */
public class Instructor extends User implements Serializable{
    
    private ArrayList<Course> courseList;
    
    public Instructor(String name, String username, String password)
    {
        super(name, username, password);
        courseList = new ArrayList();
    }
    
    public Instructor()
    {
        super();
        courseList = new ArrayList<Course>();
    }
    
    /**
     * add a course the instructors course set.
     * @param course The course to be added.
     */
    public void addCourse(Course course)
    {
        courseList.add(course);
        //TODO add the course to the course manager
        //and decide if the new course should be created or passed in.
        //Check list for course before adding.
    }
    
    /**
     * Remove a course from the instructors course list
     * @param course Remove this course.
     */
    public void removeCourse(Course course)
    {
        for(Course i : courseList)
        {
            if (i.equals(course))
            {
                courseList.remove(course);
                //TODO add break if course only exists once in the list.
            }
        }
    }

    public ArrayList<Course> getCourseList()
    {
        return courseList;
    }
    
}
